﻿using System;

class ParsingUrlAddress
{
    static void Main()
    {
        string someText = "http://www.devbg.org/forum/index.php";
        string firstTag = "<upcase>";
        string secondTag = "</upcase>";
        
        // protocol
        int indexP = someText.IndexOf(':', 0);
        string protocol = someText.Substring(0, indexP);
        Console.WriteLine("[protocol] = \"{0}\"", protocol);

        // server
        int indexS = someText.IndexOf('/', indexP + 3);
        string server = someText.Substring(indexP + 3, indexS - (indexP +3));
        Console.WriteLine("[server] = \"{0}\"", server);

        // resource
        string resource = someText.Substring(indexS + 1);
        Console.WriteLine("[resource] = \"{0}\"", resource);
    }
}
